/*
7-49 Have Fun with Numbers
分数 20
作者 陈越
单位 浙江大学

Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication.  Double it we will obtain 246913578, which happens to be another 9-digit number consisting exactly the numbers from 1 to 9, only in a different permutation.  Check to see the result if we double it again!

Now you are suppose to check if there are more numbers with this property.  That is, double a given number with k digits, you are to tell if the resulting number consists of only a permutation of the digits in the original number.
Input Specification:

Each input contains one test case.  Each case contains one positive integer with no more than 20 digits.
Output Specification:

For each test case, first print in a line "Yes" if doubling the input number gives a number that consists of only a permutation of the digits in the original number, or "No" if not.  Then in the next line, print the doubled number.
Sample Input:

1234567899

Sample Output:

Yes
2469135798
*/

#include <stdio.h>


unsigned long long parseDigit(unsigned long long n, int digits[]) {
    unsigned long long len = 1;
    while (n > 0) {
        digits[n % 10]++;
        // digits[n % 10] = 1;
        n /= 10;
        len *= 10;
    }
    return len;
}

int main() {
    // 用两个变量来存储20位数字
    unsigned long long n1, n2 = 0;
    // 用数组来表示存在哪些数字
    // 若出现过的数字，则对应数组下标指定的元素值为 1，
    int s[10] = { 0 };
    int d[10] = { 0 };
    scanf("%12lld%lld", &n1, &n2);
    // printf("%llu, %llu\n", n1, n2);
    parseDigit(n1, s);
    unsigned long long base = parseDigit(n2, s);
    
    unsigned long long dn1 = n1 * 2 + (n2 * 2) / base;
    unsigned long long dn2 = (n2 * 2) % base;
    // printf("%llu, %llu\n", dn1, dn2);
    parseDigit(dn1, d);
    parseDigit(dn2, d);
    
    // 比较两个数组是否相等
    int equals = 1;
    for (int i = 0; i < 10; i++) {
        if (s[i] != d[i]) {
            equals = 0;
            break;
        }
    }
    if (equals) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    printf("%lu", dn1);
    if (dn2 > 0) {
        printf("%lu", dn2);
    }
    return 0;
}